#!/bin/sh

# 下载 .tmux.conf 到 $HOME 目录
download_tmuxconf() {
    TMUX_CONF_URL="https://gitcode.com/freedom3z/tmux/releases/download/v1.0/.tmux.conf"
    TMUX_CONF_PATH="$HOME/.tmux.conf"

    # 使用 curl 下载
    if command -v curl >/dev/null 2>&1; then
        curl -sSLo "$TMUX_CONF_PATH" "$TMUX_CONF_URL"
    else
        echo "Error: curl not found in BusyBox!" >&2
        exit 1
    fi

    if [ -f "$TMUX_CONF_PATH" ]; then
        echo "Downloaded .tmux.conf to $TMUX_CONF_PATH"
    else
        echo "Failed to download .tmux.conf" >&2
        exit 1
    fi
}

# 设置 LANG 环境变量
set_lang() {
    export LANG=C.UTF-8
    echo "无法输入中文时：export LANG=C.UTF-8"
}

# 主流程
main() {
    download_tmuxconf
    set_lang
}

main